import { ParameterizedContext } from 'koa'
import loginService from '../service/login.service'

type Tbody = {
  username: string
  password: string
  uuid: string
  captcha: string
}

class LoginController {
  async login(ctx: ParameterizedContext) {
    const { username, password, uuid, captcha } = ctx.request.body as Tbody
    ctx.body = await loginService.login(username, password, uuid, captcha)
  }
}

export default new LoginController()
